//
//  HomeCell.m
//  LittleSugar
//
//  Created by zhang on 15-6-13.
//  Copyright (c) 2015年 张鑫. All rights reserved.
//

#import "HomeCell.h"
#import "UIImageView+WebCache.h"
#import "MyControl.h"

@implementation HomeCell

- (void)awakeFromNib {
    self.picImage.layer.masksToBounds = YES;
    self.picImage.layer.cornerRadius = 8;
    self.likesImage.layer.masksToBounds = YES;
    self.likesImage.layer.cornerRadius = 5;
    self.bottomImage.layer.masksToBounds = YES;
    self.bottomImage.layer.cornerRadius = 8;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

//- (void)setBackgroundImage:(UIImage*)image
//{
//    UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
//    imageView.contentMode = UIViewContentModeCenter;
//    
//    self.backgroundView = imageView;
//    
//}
//
//- (void)setBackgroundImageByName:(NSString*)imageName{
//    [self setBackgroundImage:[UIImage imageNamed:imageName]];
//}


- (void)showDataWithModel:(HomeModel *)model indexPath:(NSIndexPath *)indexPath {
    [self.picImage sd_setImageWithURL:[NSURL URLWithString:model.pic] placeholderImage:nil];
    self.titleLabel.text = model.title;
    self.likesLabel.text = model.likes;
    [self.titleLabel setFont:[UIFont fontWithName:@"Verdana" size:15]];
    [self.likesLabel setFont:[UIFont fontWithName:@"Verdana" size:10]];
    //self.selectedBackgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed: @"appproduct_loadingviewcell_ligh_2t"]];
}

@end
